using System.Linq;
using Microsoft.Xna.Framework.Input;

namespace RpgXna.Model.XnaClassesWrappers
{
    public class KeyboardStateWrapper : IKeyboardStateWrapper
    {
        private  KeyboardState _kbs;

        public KeyboardStateWrapper(KeyboardState kbs)
        {
            _kbs = kbs;
        }

        public bool IsKeyDown(Keys k)
        {
            return _kbs.IsKeyDown(k);
        }

        public bool IsKeyUp(Keys k)
        {
            return _kbs.IsKeyUp(k);
        }

        public bool IsAnyKeyDown(Keys[] keyBindings)
        {
            return keyBindings.Any(kb => _kbs.IsKeyDown(kb));
        }
    }
}